package com.flyduck.common.util;


import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: flyduck-platform
 * @description: 日期工具类
 * @author: flyduck
 * @create: 2021-02-06 15:48
 **/
public class DateUtil extends cn.hutool.core.date.DateUtil {

    public static String YYYY = "yyyy";

    public static String YYYY_MM = "yyyy-MM";

    public static String YYYY_MM_DD = "yyyy-MM-dd";

    public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";

    public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";

    /**
     * 日期转换为指定格式字符串
     *
     * @param time
     * @param format
     * @return
     */
    public static String formatDateToString(Date time, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(time);
    }



}
